﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Drawing="clr-namespace:OpenLS.Drawing;assembly=OpenLS.Drawing"
                    xmlns:UI="clr-namespace:OpenLS.Drawing.UI"
                    xmlns:Internals="clr-namespace:OpenLS.Drawing.UI.Internals"
                    x:Class="OpenLS.Drawing.UI.ConnectorResources">
    <DataTemplate DataType="{x:Type Drawing:Connector}">
        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="{Binding Path=Width}"
          Height="{Binding Path=Height}">
            <TextElement.Foreground>
                <MultiBinding Converter="{x:Static Internals:DrawingConverters.ColorBaseToBrushConverter}">
                    <Binding Path="Style.FontReference.Color" />
                    <Binding RelativeSource="{RelativeSource Self}" Path="(UI:DrawingElement.ColorScheme)" />
                </MultiBinding>
            </TextElement.Foreground>
            <Path HorizontalAlignment="Stretch" StrokeThickness="{Binding ShapeProperties.LineProperties.Width, FallbackValue=1}" VerticalAlignment="Top"
            Stretch="Fill" Width="{Binding Path=Width}" Height="{Binding Path=Height}" Name="connectorPath">
                <!--BitmapEffect="{Binding BitmapEffect}"> -->
                <Path.Data>
                    <MultiBinding Converter="{x:Static Internals:DrawingConverters.ToGeometryConverter}">
                        <Binding></Binding>
                        <Binding Path="ShapeProperties.Geometry"></Binding>
                    </MultiBinding>
                </Path.Data>
                <Path.Fill>
                    <MultiBinding Converter="{x:Static Internals:DrawingConverters.FillPropertiesToBrushConverter}">
                        <Binding Path="ShapeProperties.FillProperties" />
                        <Binding RelativeSource="{RelativeSource Self}" Path="(UI:DrawingElement.ColorScheme)" />
                        <Binding Path="Style.FillReference" />
                    </MultiBinding>
                </Path.Fill>
                <Path.Stroke>
                    <MultiBinding Converter="{x:Static Internals:DrawingConverters.LineFillPropertiesToBrushConverter}">
                        <Binding Path="ShapeProperties.LineProperties.LineFillProperties" />
                        <Binding RelativeSource="{RelativeSource Self}" Path="(UI:DrawingElement.ColorScheme)" />
                        <Binding Path="Style.LineReference" />
                    </MultiBinding>
                </Path.Stroke>
            </Path>
            <Path HorizontalAlignment="Stretch" StrokeThickness="{Binding ShapeProperties.LineProperties.Width, FallbackValue=1}" VerticalAlignment="Top"
            Stretch="Fill" Width="{Binding Path=Width}" Height="{Binding Path=Height}">
                <!--BitmapEffect="{Binding BitmapEffect}"> -->
                <Path.Data>
                    <MultiBinding Converter="{x:Static Internals:DrawingConverters.ToArrowGeometryConverter}">
                        <Binding></Binding>
                        <Binding Path="ShapeProperties.Geometry"></Binding>
                    </MultiBinding>
                </Path.Data>
                <Path.Fill>
                    <MultiBinding Converter="{x:Static Internals:DrawingConverters.LineFillPropertiesToBrushConverter}">
                        <Binding Path="ShapeProperties.LineProperties.LineFillProperties" />
                        <Binding RelativeSource="{RelativeSource Self}" Path="(UI:DrawingElement.ColorScheme)" />
                        <Binding Path="Style.LineReference" />
                    </MultiBinding>
                </Path.Fill>
                <Path.Stroke>
                    <MultiBinding Converter="{x:Static Internals:DrawingConverters.LineFillPropertiesToBrushConverter}">
                        <Binding Path="ShapeProperties.LineProperties.LineFillProperties" />
                        <Binding RelativeSource="{RelativeSource Self}" Path="(UI:DrawingElement.ColorScheme)" />
                        <Binding Path="Style.LineReference" />
                    </MultiBinding>
                </Path.Stroke>
            </Path>
        </Grid>
    </DataTemplate>
</ResourceDictionary>